//package com.mytrip.aop;
//
//@Aspect
//public class BackendAccessLogAspect extends BaseAspect {
//	private List<String> actionAccessExcludeList = new ArrayList<String>(0);
//	
//	private BackendLogManager backendLogManager;
//	
//	public void setActionAccessExcludeList(List<String> actionAccessExcludeList) {
//		this.actionAccessExcludeList = actionAccessExcludeList;
//	}
//
//	public void setBackendLogManager(BackendLogManager backendLogManager) {
//		this.backendLogManager = backendLogManager;
//	}
//	
//	// ~ method ==================================================================
//
//	@Pointcut("execution(* com.newheight.webapp.action..*Action.*(..)) " +
//				"&& !execution(* com.newheight.webapp.action..*Action.get*(..)) " +
//				"&& !execution(* com.newheight.webapp.action..*Action.set*(..))")
//	public void actionSecurityPt() {
//	}
//	
//	@Around("actionSecurityPt() && target(action)")
//	public Object securityAccess(ProceedingJoinPoint pjp, StrutsActionAdapter action) throws Throwable {		
//		Method method = ((MethodSignature) pjp.getSignature()).getMethod();	
//		String methodName = null;
//		String actionName = BeanUtil.extractLShortName(action.getClass());		
//		
//		for(String aopAccessExcludeActionName :  actionAccessExcludeList){
//			if (aopAccessExcludeActionName.equals(actionName)){
//				return pjp.proceed();
//			}			
//		}
//
//		/*if (! method.isAnnotationPresent(WriteMethod.class)){
//			return pjp.proceed();
//		}*/
//		
//		BackendAccessLog backendAccessLog = new BackendAccessLog();
//		
//		backendAccessLog.setActionName(actionName);		
//		StringBuffer methodSg = new StringBuffer();
//		methodSg.append(method.getName()).append("(");
//		
//		Class[] argTypes = method.getParameterTypes();
//		for(Class argType : argTypes){
//			methodSg.append(argTypes.getClass().toString()).append(",");
//		}
//		if (methodSg.toString().endsWith(",")){
//			methodName = methodSg.substring(0, methodSg.length() - 1);
//		} else {
//			methodName = methodSg.toString();
//		}
//		
//		methodName = methodName + ")";
//		backendAccessLog.setMethodName(methodName);
//		
//		backendAccessLog.setIp(CtxSessionBag.getSessionBag().getIp());
//		backendAccessLog.setSessionNbr(CtxSessionBag.getSessionBag().getSessionNbr());		
//		BackOperator backOperator = CtxSessionBag.getSessionBag().getBackOperator();
//		if (backOperator != null) {
//			backendAccessLog.setOperatorId(backOperator.getId());
//			backendAccessLog.setOperatorType(BackendAccessLog.OPERATOR_TYPE_BACK_OPERATOR);
//		}
//		backendAccessLog = backendLogManager.saveBackendAccessLog(backendAccessLog);	
//
//		CtxSessionBag.setBackendAccessLog(backendAccessLog);		
//	
//		return pjp.proceed();
//		
//	}
//}
